package com.system.connect.springboot_flowers.mapper;


import com.system.connect.springboot_flowers.entity.Subscribe;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SubscribeMapper {
    @Insert("INSERT INTO subscribe (email, create_time, status) VALUES (#{email}, #{createTime}, #{status})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(Subscribe subscribe);

    @Select("SELECT * FROM subscribe WHERE email = #{email}")
    Subscribe findByEmail(String email);
}
